package com.example.mall.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.util.Date;

import java.io.Serializable;

/**
 * <p>
 * 错误日志表
 * </p>
 *
 * @author whale
 * @since 2025-05-16
 */
@TableName("tb_error_logs")
public class ErrorLogs extends Model<ErrorLogs> {

    private static final long serialVersionUID = 1L;

    /**
     * 错误日志唯一标识
     */
    @TableId("error_id")
    private Long errorId;
    /**
     * 错误代码
     */
    @TableField("error_code")
    private String errorCode;
    /**
     * 错误信息
     */
    @TableField("error_message")
    private String errorMessage;
    /**
     * 错误堆栈信息
     */
    @TableField("stack_trace")
    private String stackTrace;
    /**
     * 错误来源（如模块名称、文件名）
     */
    @TableField("log_source")
    private String logSource;
    /**
     * 操作用户ID（关联用户表，如果是用户操作）
     */
    @TableField("user_id")
    private Long userId;
    /**
     * 操作IP地址
     */
    @TableField("ip_address")
    private String ipAddress;
    /**
     * 错误发生时间
     */
    @TableField("create_date")
    private Date createDate;


    public Long getErrorId() {
        return errorId;
    }

    public void setErrorId(Long errorId) {
        this.errorId = errorId;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public String getStackTrace() {
        return stackTrace;
    }

    public void setStackTrace(String stackTrace) {
        this.stackTrace = stackTrace;
    }

    public String getLogSource() {
        return logSource;
    }

    public void setLogSource(String logSource) {
        this.logSource = logSource;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @Override
    public String toString() {
        return "ErrorLogs{" +
        ", errorId=" + errorId +
        ", errorCode=" + errorCode +
        ", errorMessage=" + errorMessage +
        ", stackTrace=" + stackTrace +
        ", logSource=" + logSource +
        ", userId=" + userId +
        ", ipAddress=" + ipAddress +
        ", createDate=" + createDate +
        "}";
    }
}
